package com.example.game2048;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;

import com.example.game2048.view.GridView;

public class MainActivity extends AppCompatActivity {
    private TextView textView;
    private TextView scoreText;
    private GridView gridView;
    private Button newGameButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        textView = findViewById(R.id.textView);
        scoreText = findViewById(R.id.scoreText);
        gridView = this.findViewById(R.id.gridView);
        newGameButton = findViewById(R.id.newGameButton);

        gridView.setActivity(this);
        gridView.setScoreText(scoreText);
        newGameButton.setOnClickListener(l->{
            gridView.restart();
        });
    }
}